home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Linux Cubed Series 7: Sunsite
/
Linux Cubed Series 7 - Sunsite Vol 1.iso
/
system
/
backup
/
kbackup-.000
/
KBackup-1.2.7.tar
/
KBackup
/
src
/
write_data_src
< prev
Wrap
Text File
|
1996-03-27
|
2KB
|
69 lines
#
# /home/kbackup/.CVSROOT/KBackup/src/write_data_src,v 1.10 1996/03/27 20:03:38 kbackup Exp
#
# This file is Copyright (C) 1995 by Karsten Ballⁿder
# Karsten.Ballueder@stud.uni-karlsruhe.de
#
# It is part of the KBackup package, see the file COPYING for details.
#
#
# function to reliably write data to tape, including double buffering
# and multi-volume handling
#
WriteData_src_loaded=YES
write_data()
{
if [ "$1" = "-raw" ]
then
shift
if [ "$1" != "" ]
then
wdfile="$1"
else
wdfile="$device"
fi
multibuf_cmd=`echo dd of=$wdfile bs=2048`
else
if [ "$1" != "" ]
then
wdfile="$1"
else
wdfile="$device"
fi
if [ "$use_multibuf" = "YES" ]
then
set_multibuf_options WRITE
multibuf_cmd=`echo $MULTIBUF $multibuf_options -b $multibuf_blksize -n $multibuf_nblocks "$wdfile" `
else
multibuf_cmd=`echo dd of=$wdfile bs=2048 `
fi
fi
if [ "$remote_mode" = "YES" ]
then
if [ "$double_buffering" = "YES" ]
then
last_command="su in write_data()"
su $remote_uid -c "rsh $remote_host \"$DD ibs=$multibuf_blksize conv=sync obs=$ddbufsize \
| $multibuf_cmd \""
else
last_command="su in write_data()"
su $remote_uid -c "rsh $remote_host \"$DD ibs=$multibuf_blksize conv=sync | $multibuf_cmd \""
fi
else
if [ "$double_buffering" = "YES" ]
then
last_command="$DD and multibuf in write_data()"
$DD ibs=$multibuf_blksize conv=sync obs=$ddbufsize | `echo $multibuf_cmd` 2>$STDERR
else
last_command="$DD and multibuf in write_data()"
$DD ibs=$multibuf_blksize conv=sync | `echo $multibuf_cmd` 2>$STDERR
fi
fi
}